#include <limits.h>
#include <stdio.h>

#include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>

using namespace std;

int main() {
  int n;
  cin >> n;
  vector<int> A;
  while (n--) {
    int x;
    cin >> x;
    A.push_back(x);
  }
  int max_ = INT_MIN;
  int min_ = INT_MAX;
  int sum = 0;
  for (int i = 0; i < A.size(); ++i) {
    int x = A[i];
    if (x > max_) max_ = x;
    if (x < min_) min_ = x;
    sum += x;
  }

  cout << max_ << endl;
  cout << min_ << endl;
  cout << sum << endl;
  return 0;
}